{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "import matplotlib\n",
    "matplotlib.rcParams['font.sans-serif'] = ['SimHei']\n",
    "matplotlib.rcParams['font.family'] = 'sans-serif'\n",
    "matplotlib.rcParams['axes.unicode_minus'] = False"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.加载数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def loadDataSet(filename):\n",
    "    X = []\n",
    "    Y = []\n",
    "    \n",
    "    with open(filename, 'rb') as f:\n",
    "        for idx, line in enumerate(f):\n",
    "            line = line.decode('utf-8').strip()\n",
    "            if not line:\n",
    "                continue\n",
    "            eles = line.split()\n",
    "            eles = list(map(float, eles))\n",
    "            \n",
    "            if idx == 0:\n",
    "                numFea = len(eles)\n",
    "            X.append(eles[:-1])\n",
    "            Y.append([eles[-1]])\n",
    "    \n",
    "    return np.array(X), np.array(Y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.定义sigmoid函数\n",
    "$$ g(z) = \\frac{1}{1+e^{(-z)}} $$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def sigmoid(z):\n",
    "    return 1.0 / (1.0 + np.exp(-z))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3.定义代价函数\n",
    "$$ J(\\theta) = - \\frac{1}{m} [ \\sum_{i=1}^{m} (y^{(i)}\\log(h_{\\theta}(x^{(i)})) + (1-y^{(i)})\\log{(1-h_{\\theta}(x^{(i)}))})] + \\lambda \\frac{1}{2m} \\sum_{j=1}^n \\theta_j^2 $$ <br/>\n",
    "其中，$ h_\\theta(X) = g(\\theta^T X) = sigmoid(\\theta^T X)  $  <br/><br/>\n",
    "$ \\sum_{i=1}^{m} (y^{(i)}\\log(h_{\\theta}(x^{(i)})) + (1-y^{(i)})\\log{(1-h_{\\theta}(x^{(i)}))}) $ 为 $ \\sum cost $ 表示拟合程度 <br/><br/>\n",
    "$ \\lambda \\sum_{j=1}^n \\theta_j^2 $ 表示 $ L_2 $ 正则化，用来表示模型复杂度（作用时不要过拟合）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def J(theta, X, Y, theLambda=0):\n",
    "    m, n = X.shape\n",
    "    h = sigmoid(np.dot(X, theta))\n",
    "    J = (-1.0/m)*(np.dot(np.log(h).T,Y)+np.dot(np.log(1-h).T,1-Y)) + (theLambda/(2.0*m))*np.sum(np.square(theta[1:]))\n",
    "    if np.isnan(J[0]):\n",
    "        return np.inf\n",
    "    # 其实J里面只有一个数值，需要取出该数值\n",
    "    return J.flatten()[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4.定义梯度下降函数\n",
    "$$ \\theta_j := \\theta_j - \\alpha  \\frac{1}{m}(h_\\theta(x^{(i)})-y^{(i)})x_j^{(i)} - \\alpha \\frac{\\lambda}{m}\\theta_j $$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "def gradient(X, Y, options):\n",
    "    '''\n",
    "    options.alpha 学习率\n",
    "    options.theLambda 正则参数λ\n",
    "    options.maxLoop 最大迭代轮次\n",
    "    options.epsilon 判断收敛的阈值\n",
    "    options.method\n",
    "        - 'sgd' 随机梯度下降\n",
    "        - 'bgd' 批量梯度下降\n",
    "    '''\n",
    "    \n",
    "    m, n = X.shape\n",
    "    \n",
    "    # 初始化模型参数，n个特征对应n个参数\n",
    "    theta = np.zeros((n,1))\n",
    "    \n",
    "    cost = J(theta, X, Y)  # 当前误差\n",
    "    costs = [cost]\n",
    "    thetas = [theta]\n",
    "    \n",
    "    # Python 字典dict.get(key, default=None)函数返回指定键的值，如果值不在字典中返回默认值\n",
    "    alpha = options.get('alpha', 0.01)\n",
    "    epsilon = options.get('epsilon', 0.00001)\n",
    "    maxloop = options.get('maxloop', 1000)\n",
    "    theLambda = float(options.get('theLambda', 0)) # 后面有 theLambda/m 的计算，如果这里不转成float，后面这个就全是0\n",
    "    method = options.get('method', 'bgd')\n",
    "    \n",
    "    # 定义随机梯度下降\n",
    "    def _sgd(theta):\n",
    "        count = 0\n",
    "        converged = False\n",
    "        while count < maxloop:\n",
    "            if converged :\n",
    "                break\n",
    "            # 随机梯度下降，每一个样本都更新\n",
    "            for i in range(m):\n",
    "                h =sigmoid(np.dot(X[i].reshape((1,n)), theta))\n",
    "                \n",
    "                theta = theta - alpha*((1.0/m)*X[i].reshape((n,1))*(h-Y[i]) + (theLambda/m)*np.r_[[[0]], theta[1:]])\n",
    "                thetas.append(theta)\n",
    "                cost = J(theta, X, Y, theLambda)\n",
    "                costs.append(cost)\n",
    "                if abs(costs[-1] - costs[-2]) < epsilon:\n",
    "                    converged = True\n",
    "                    break\n",
    "            count += 1\n",
    "        return thetas, costs, count\n",
    "    \n",
    "    # 定义批量梯度下降\n",
    "    def _bgd(theta):\n",
    "        count = 0\n",
    "        converged = False\n",
    "        while count < maxloop:\n",
    "            if converged :\n",
    "                break\n",
    "            \n",
    "            h = sigmoid(np.dot(X, theta))\n",
    "            theta = theta - alpha*((1.0/m)*np.dot(X.T, (h-Y)) + (theLambda/m)*np.r_[[[0]],theta[1:]])\n",
    "            \n",
    "            thetas.append(theta)\n",
    "            cost = J(theta, X, Y, theLambda)\n",
    "            costs.append(cost)\n",
    "            if abs(costs[-1] - costs[-2]) < epsilon:\n",
    "                converged = True\n",
    "                break\n",
    "            count += 1\n",
    "        return thetas, costs, count\n",
    "    \n",
    "    methods = {'sgd': _sgd, 'bgd': _bgd}\n",
    "    return methods[method](theta)   "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 测试一下"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.加载数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [],
   "source": [
    "originX, Y = loadDataSet('./data/linear.txt')\n",
    "m,n = originX.shape\n",
    "X = np.concatenate((np.ones((m,1)), originX), axis=1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**bgd**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.09333430872838289, 68010, 3.723447561264038)"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# bgd\n",
    "# 设置超参数\n",
    "options = {\n",
    "    'alpha':0.05,\n",
    "    'epsilon':0.00000001,\n",
    "    'maxloop':100000,\n",
    "    'method':'bgd' # sgd\n",
    "}\n",
    "# 训练模型\n",
    "import time\n",
    "start = time.time()\n",
    "thetas, costs, iterationCount = gradient(X, Y, options)\n",
    "end = time.time()\n",
    "btime = end - start\n",
    "costs[-1], iterationCount, btime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0,0.5,'$x_2$')"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3XuUFPW1L/DvngcwM4CKDISgAz5gskRRYFQ8l3OCBoxBlxp1ncmVE++61yxMxOR4NSdgxHiSKBpXdGliiOFgVoxRLyYmajy+IGLiM3EYkuMjBzSIighiVBge82Bm3z9+XX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86IYmfY5v7i1R9CFX1n1R1tqrOBvBnVf2S7ZgCWA7giyLyBwC1MMMOrrsQ5mj3ShF5UkTabQeUMmthhp4A4FgAm+yFkmpJ/Bxb219wUR6RY0RkJICnAPwOwOcAzFTVHXajomrHZEHkoMw01LkA/qCqiZjZR+nGZEFERL5SVbMgIqJoMFkQEZEvJgsiIvLFZEFERL6YLIgiICJrRGRu5vY1IvID2zERVSLR7T6IHHY1gO+IyBgA02DaMhAlFqfOEkVERH4P065jtqp2icjhAK4EcICqnmc3OqLScBiKKAIicgyAcQB6VLULAFR1o6peaDcyovIwWRCFTETGAbgLwFkAdovIZy2HRFQxJguiEIlII4BfA7hcVf8Kc62Sf7caFFEIWLMgiomIHAzgWpieTytU9TrLIREFxmRBRES+OAxFRES+mCyIiMgXkwUREflisiAiIl9MFkRE5IvJgoiIfDFZEBGRLyYLIiLyxWRBRES+/j/DglZUR8yGlQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1b60b3eb278>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "# 绘制决策边界\n",
    "for i in range(m):\n",
    "    x = X[i]\n",
    "    if Y[i] == 1:\n",
    "        plt.scatter(x[1], x[2], marker='*', color='blue', s=50)\n",
    "    else:\n",
    "        plt.scatter(x[1], x[2], marker='o', color='green', s=50)\n",
    "\n",
    "hSpots = np.linspace(X[:,1].min(), X[:,1].max(), 100)\n",
    "theta0, theta1, theta2 = thetas[-1]\n",
    "\n",
    "vSpots = -(theta0+theta1*hSpots)/theta2\n",
    "plt.plot(hSpots, vSpots, color='red', linewidth=.5)\n",
    "plt.xlabel(r'$x_1$')\n",
    "plt.ylabel(r'$x_2$')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0,0.5,'代价J')"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"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PvhsBqQ9gpOAPZL+Np39eZIbCBIR/xrJLci/RXIr75HrvzJt15OexXQRsHpEszNI7pL5DpKhpm8BbyAJhpXATyb52zI7Lg4GK7z0OMIGkqGcj5KM+f9lRPTWaH4r8E5JpYHTWCV1kAw5fSBtcz3wz8Bdkj4ysGJE3E1yT/zvk9zh86vpPu4lObZwTy7foNk4eSjJCik9A+hykiGi7wH/PiIeTRe/m+ThMwBKXwBExB5Jt5Hc9O0JSQ+ki74GVGoMR31G0jeB/xwRDwOfJXkozw3AI5LOBF4MHAHOI7mNtVlDORisqP4D8FuS4aLrgMsl9ZI8eKYdOEFSheROnG1DV4yI/5Zet/BO4NKI+D2ApMuA70TEvwxp+x5JbwHmKnm06y0kxxIuBM4B/gn4S+AJ4BuS3lrr+IXZVPJN9KyQJJUacb2ApEpE9KXTAkoR0T/wPvwf0qYBB4OZmQ3jg89mZjaMg8HMzIZxMJiZ2TAOBjMzG+b/A6o6Q3g3Gzl7AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1b608fe1be0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 绘制误差曲线\n",
    "plt.plot(range(len(costs)), costs)\n",
    "plt.xlabel(u'迭代次数')\n",
    "plt.ylabel(u'代价J')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEGCAYAAACUzrmNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3XmYHPV95/H3t+/u6Tk1o9GtkQZxI3EIgThlLpsEn7ENiQmOccyaYDaxN9n1lTy2nzjZ9To+kgBrHGxjE9vxhTE+FrBBRvEi0Ag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dw7t/YDbxHVdtO8vesV6dPH0TkH4HBI5EDqnrtZOsTkTjwI5x7GXao6gfGW98JPne8v+OTOHddX4nzc8q3qHOjmjFD7MjCeN09wH+ZYJkY8B6czuz+BLjEbf+FOp0qnu2enrkDeElVrwLmi8hKd7lLgWdOFBSuD7nvvRp4HbhdVb8K/BXwLffI4oRBMZaqfgLnBsH/OWLHPtn65uPcQX8d0CQijSdY36T+Drf9NPdzf4LT2aIxo1hYGK87DGzH6fRsrMGuCo6oai+wB6djRnHbn3WHzwPNwBnAO91v6suBhe78l1T1JxPUcfaI9W0EzprSXzE5k60vDfw58O9AHcPbYTJO9Hd82x3uxekx1phRLCxMKfgyTk+k4JxqanDH3zLB+y5yhytxThO9CnzFPSXzaZwdIzh95EzkZZxv+LjDlyfxnokM4BwVDXZ2ONn6PohzGuqPcXqmPdH6xnOiv6Nv/MWNcVhYGM9T1ReA37qTPwPuFpH/Axyb4K3vFpHfAW+o6mac7qhvFJGngQ/j9Jg7Wf8GnOO+dwXOef+ZegJ4l1vjlVOo7wngE8CT7vTCEe0j1zee2fg7TBmwC9zGGGMmZEcWxhhjJmRhYYwxZkIWFsYYYyZkYWGMMWZCFhbGGGMmZGFhjDFmQhYWxhhjJvT/AVFqEn1W77MjAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1b608f7eb70>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 绘制参数theta变化\n",
    "thetasFig, ax = plt.subplots(len(thetas[0]))\n",
    "thetas = np.asarray(thetas)\n",
    "for idx, sp in enumerate(ax):\n",
    "    thetaList = thetas[:, idx]\n",
    "    sp.plot(range(len(thetaList)), thetaList)\n",
    "    sp.set_xlabel('Number of iteration')\n",
    "    sp.set_ylabel(r'$\\theta_%d$'%idx)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**sgd**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.18906151167614432, 107, 0.5934193134307861)"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# sgd\n",
    "options = {\n",
    "    'alpha':0.5,\n",
    "    'epsilon':0.00000001,\n",
    "    'maxloop':100000,\n",
    "    'method':'sgd' \n",
    "}\n",
    "# 训练模型\n",
    "import time\n",
    "start = time.time()\n",
    "S_thetas, S_costs, S_iterationCount = gradient(X, Y, options)\n",
    "end = time.time()\n",
    "btime = end - start\n",
    "S_costs[-1], S_iterationCount, btime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0,0.5,'$x_2$')"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3XmU3HWZ7/H3k+7OHpZAQCbQIBCRBJJAwjYTZ8JM4mDgKIKYuSDe42XEJYwyODMJgjqOiI5n9OgIUTnBK4p4gwOugwiMoKKgdEIHwiogawgECKETkk6n+7l/fKvspqm96rfW53VOn1RX/6r6SVX19/n9vs93MXdHRESkkjFJByAiIumnZCEiIlUpWYiISFVKFiIiUpWShYiIVKVkISIiVSlZiIhIVUoWIiJSlZKFiIhUpWQhIiJVdSYdQKvsvffeftBBByUdhohIpqxZs+YFd59W7bjcJIuDDjqInp6epMMQEckUM3uiluPUDSUiIlUpWYiISFVKFiIiUpWShYiIVKVkISIiVcWSLMxsXzP7deH2dDN72sxuK3yVHbJlZlea2R1mdnEccYqISGmRJwsz2xO4Cph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/x6VYeIFjby8ynSzc/QMjvzezTwIr3f3ltH5gR8c8wjIz+wzwdmB1jCFVVSpmM5sKfBU4Pf6IqqvwOmfBJOCZwu2XyEbXZCal/XNciochrLG3F3nrhlpEeBFvA+aa2aqE46nKzJab2XsL3+4BvJxkPLUoFAK/D1zo7k8kHU8ObWW45jaZ/P2dpkIWP8dJthe5+hC6+1+6+0J3Xwj0uvvfJx1TDa4AzjazXwEdhG6HtDuHcLZ7kZndZmZLkw4oZ9YQup4A5gCPJxdKrmXxc5xYe6FJeSIpY2a7Ab8G/gd4G3C8u29JNippd0oWIilUGIa6GPiVu2diZJ/km5KFiIhUlauahYiIREPJQkREqlKyEBGRqpQsRESkKiULkQiY2a1mtrhw+xIz+8+kYxJpRqaX+xBJsU8B/2Zm+wBHEZZlEMksDZ0ViYiZ/ZKwXMdCd+8zs4OBi4Dd3f1dyUYnUh91Q4lEwMyOBPYD+t29D8DdH3P3c5KNTKQxShYiLWZm+wHfBd4BbDOzv004JJGmKVmItJCZTQSuBz7m7g8Q9ir510SDEmkB1SxEYmJmewGfJaz5tMrdP5dwSCI1U7IQEZGq1A0lIiJVKVmIiEhVShYiIlKVkoWIiFSlZCEiIlUpWYiISFVKFiIiUpWShYiIVKVkISIiVf1//Rq0/htFEVgAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1b608fcf8d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "# 绘制决策边界\n",
    "for i in range(m):\n",
    "    x = X[i]\n",
    "    if Y[i] == 1:\n",
    "        plt.scatter(x[1], x[2], marker='*', color='blue', s=50)\n",
    "    else:\n",
    "        plt.scatter(x[1], x[2], marker='o', color='green', s=50)\n",
    "\n",
    "hSpots = np.linspace(X[:,1].min(), X[:,1].max(), 100)\n",
    "theta0, theta1, theta2 = S_thetas[-1]\n",
    "\n",
    "vSpots = -(theta0+theta1*hSpots)/theta2\n",
    "plt.plot(hSpots, vSpots, color='red', linewidth=.5)\n",
    "plt.xlabel(r'$x_1$')\n",
    "plt.ylabel(r'$x_2$')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0,0.5,'代价J')"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEHCAYAAACumTGlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3XeYVdW5x/HvyzB0pIkYUUAUu6JCVATJWLCALZrEFow3GmJNchMTUbEhKjHGGDQaMcRrorFFY1AUEQUBKcJQpAkIDCB1qEMbmPLeP84e2pwzBWaf+vs8zzzus846+7zrEfjNLmttc3dERERqJboAERFJDgoEEREBFAgiIhJQIIiICKBAEBGRgAJBREQABYKIiAQUCCIiAigQREQkUDvRBVTHwQcf7O3atUt0GSIiKSM3N3etu7esSt+UCoR27doxZcqURJchIpIyzGxJVfvqlJGIiAAKBBERCSgQREQECDEQzGyImU0ws34x3r/NzEYHP9PN7MWwahERkcqFEghmdhWQ5e5dgPZm1mHfPu7+grvnuHsOMBZ4KYxaRESkasI6QsgB3gq2RwDdYnU0s9ZAK3ePevuQmfUxsylmNiU/P7/GCxURkYiwAqEhsDzYXg+0qqDvHcALsd5098Hu3tndO7dsWaVbaff9PMs3bqegsKjanxURySRhBcIWoH6w3SjW95hZLeBcYHRIdVBU4nQd+Bn/GJ8X1leIiKSFsAIhl92niToCeTH6nQNM8hAf7GwW+a8eHS0iUrGwAuE9oLeZPQ38CJhtZgOi9LsIGBNSDQAEeYDyQESkYqEsXeHuBWaWA/QAnnT3VcCMKP3uC+P792TBIYKOEEREKhbaWkbu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KwzuSjqbyIzbPbUFXgB+QuSU0gfAFUQCoQtJsHSBZDYFgmS84DrBECKnbPoTOad/t7sXRen+DnCTmdUqux3VzBoSObV0b9CnL/AvYJyZPVL2QXf/gsj6958SWen0teA7phK5djA5lAGKVJFOGUlGCu7ouYzIqaCRwNXuvjR4+xbg/LKuwQ8A7p5vZu8DfwZWm9m84K3XgdpRTjs9Z2b/AX7j7ouAvxJ5CFA/YImZHQmcCOwgsoDhlLDGLFIZBYJkqp8Bi4mcFroDuMzMioisQFoPaGpmtYms1ll3zw+6+6PBvIObgO7uvgLAzC4FPnL3N/boe6eZXUfkUZLNiJwyWkRkJc8TiKwKejewGvi3mV0f7fqESDxocTvJSGZWKxH3+5tZbXcvDrYNqOXuJWWvXX8hJYEUCCIiAuiisoiIBBQIIiICKBBERCSgQBAREQD+HwxOm7SE/92OAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1b607e264e0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 绘制误差曲线\n",
    "plt.plot(range(len(S_costs)), S_costs)\n",
    "plt.xlabel(u'迭代次数')\n",
    "plt.ylabel(u'代价J')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEGCAYAAABPdROvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzs3Xd4VVXWx/HvSrnpvUJIIfQaSmgqiiAoomMbey+DzthGxxlRxIrIOL7WGQuKvc3ojAUpUiyAgkhApPcECCQhvff9/nEvIUJCQtotWZ/n4fHck33P3QtDfjlnn72PGGNQSimlWsrN3h1QSinl3DRIlFJKtYoGiVJKqVbRI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AtgCbAcO5T/8zcBA7p9399kO9WifHHADeVcAAADpSURBVPYE2NFVK6qpWr/fwEngNrCGxd+hirJ2zOTyI5ELS0SBRHrKNWA41xeIbMcAox3O253LBjH09Aa4nsM8l4mHJkR+o05eszizejC36/pF9KYwM+uifieIoa2jRGbksusVKWvHz+LD5X+mQCI9w91fAg9y8y4wYWY3ifTkSzliZo+A9+7+nEjXftDMHgJniYzJVd0CduW524j3DHXNAYezjkNd1G8OmATu5/ZAW3n79YosRzukR+llu4iI1KIeiYiI1KJAIiIitSiQiIhILQokIiJSiwKJiIjUokAiIiK1KJCIiEgtfwAoVd7J5to+9gAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1b609b27b70>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 绘制参数theta变化\n",
    "thetasFig, ax = plt.subplots(len(S_thetas[0]))\n",
    "thetas = np.asarray(S_thetas)\n",
    "for idx, sp in enumerate(ax):\n",
    "    thetaList = thetas[:, idx]\n",
    "    sp.plot(range(len(thetaList)), thetaList)\n",
    "    sp.set_xlabel('Number of iteration')\n",
    "    sp.set_ylabel(r'$\\theta_%d$'%idx)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**绘制非线性决策边界**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(118, 28)"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.preprocessing import PolynomialFeatures\n",
    "# PolynomialFeatures专门生成多项式特征，并且多项式包含的是相互影响的特征集\n",
    "# 比如：一个输入样本是２维的。形式如[a,b] ,则二阶多项式的特征集如下[1,a,b,a^2,ab,b^2]\n",
    "# 非线性决策边界\n",
    "ori_X, y = loadDataSet('./data/non_linear.txt')\n",
    "m, n = ori_X.shape\n",
    "X = np.concatenate((np.ones((m,1)), ori_X), axis=1)\n",
    "\n",
    "# 生成阶数为6的多项式\n",
    "poly = PolynomialFeatures(6)\n",
    "XX = poly.fit_transform(X[:,1:3])\n",
    "m, n = XX.shape\n",
    "m, n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 训练数据\n",
    "options = {\n",
    "    'alpha': 1.0,\n",
    "    'epsilon': 0.000001,\n",
    "    'theLambda': 100, # 0\n",
    "    'maxloop': 10000,\n",
    "    'method': 'bgd'\n",
    "}\n",
    "thetas, errors, iterationCount = gradient(XX, y, options)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([[ 0.01886043],\n",
       "        [-0.01743511],\n",
       "        [ 0.00586624],\n",
       "        [-0.05490371],\n",
       "        [-0.01317879],\n",
       "        [-0.03829449],\n",
       "        [-0.01840692],\n",
       "        [-0.00770525],\n",
       "        [-0.00890777],\n",
       "        [-0.02268133],\n",
       "        [-0.04331045],\n",
       "        [-0.00236346],\n",
       "        [-0.01410467],\n",
       "        [-0.00350756],\n",
       "        [-0.04127566],\n",
       "        [-0.02095624],\n",
       "        [-0.00470873],\n",
       "        [-0.00358181],\n",
       "        [-0.00630598],\n",
       "        [-0.00501953],\n",
       "        [-0.03187932],\n",
       "        [-0.0340835 ],\n",
       "        [-0.00107813],\n",
       "        [-0.00700682],\n",
       "        [-0.00038735],\n",
       "        [-0.00796047],\n",
       "        [-0.00155451],\n",
       "        [-0.04097656]]), 0.09333430872838289, 9)"
      ]
     },
     "execution_count": 101,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "thetas[-1], costs[-1], iterationCount"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Anaconda\\lib\\site-packages\\matplotlib\\contour.py:967: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.contour.QuadContourSet at 0x1b60938f0f0>"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD6CAYAAACoCZCsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJztnXmYFOW1uN8zDKPjzKCgBHUUkMUFFxJE4y4qGkQTiUu4yr3RhFyNQSNx+QFqEheEG2JIiBGjjmZRMWBy5bqCGEMABWXA3RhRg4iIDkJgABm28/vj63aGobunu7q27j7v89TT3dXVU6dqur/zfWcVVcUwDMMoPcqiFsAwDMOIBlMAhmEYJYopAMMwjBLFFIBhGEaJYgrAMAyjRDEFYBiGUaKYAjAMwyhRTAEYhmGUKKYADMMwSpTyqAXIxF577aXdu3ePWgzDMIyCYtGiRatUtXNbx8VaAXTv3p36+vqoxTAMwygoROSDbI4zE5BhGEaJYgrAMAyjRDEFYBiGUaKYAjAMwyhRTAEYhmGUKKYADMMwShRTAIZhGCWKKQDDMIwSJdaJYIaRisamRqa+OZUlny2h9569GXroUGp2qYlaLMMoOEwBGAXFvGXzGPzQYLbrdjZs2UBV+yqunnk1Tw17ihO6nhC1eIZRUJgCMAqGxqZGBj80mMbNjV/s27BlAwCDHxrMimtWUF1RHZV4vmMrHSNoTAEYBcPUN6eyXbenfG+7bmfqG1MZ3m94yFIFg610jDAwJ7BRMCz5bMkXM/7WbNiygXdXvxuyRMHQcqWTvN4NWzbQuNntX795fcQSGsWCKQCjYOi9Z2+q2lelfK+qfRW9OvUKWaJgyGalYxh+YArAKBiGHjqUMkn9lS2TMoYeNjRkiYKhVFY6RvSYAjAKhppdanhq2FPUVNR8s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+DTNPKGKVeqY7L5XOCyRXC/cpIvjSxBf9eylQ0I/TeaZBswFFiX4ZgBNF/DHKB/mn2hUzIKILEsTC4HZ+M08EeJt1cDXdr4EyOAuxLPFwIDVfVooD0wOCLZUslRleVng5Yt+fljgY6quiCNvH6RzXWnOsbX+5WHbECo9ytX+QL/ruUhW5LAfqPpUNV1qrq2jcOi+t61Scn0BFbVy1q+FpFJQGXiZTUZlKGIlAGnADckdr2mqk2J5/VAXmaDPGRLJcf6LD8btGyISCfgDuC8DPL6RTbXneoYX+9XHrKFfb9ylS/w71oesgX+G82T5DWsxV3D+jT7QqdkVgApWETzcrIvsDTDsScCL2pz0sQDItJXRNoBQ4BXI5ItlRy5XFdgsolIBfAIMEZVkwX9grxv2ciV6pig71dWskVwv3KSL40ssbh3CcL+jeZCVN+7tlHVktyADrgvxUTgH8DuQB9gbIpjxwHntnh9GPAa8DpwW1SypZIDp9SfByYB/wQOiEi2y4E1wOzENjTI+5ZCrr4pZEol+077Qvh/ppIt1PvlQb7Qv2vZypY4LtTfaIrzz048ngpc0eq9bsCbifu0EGiXal/QMqbaSjoTOOHBPx2Yo6oro5anJfnIJiKVwFnAYlV9P06yBUk2cqU6Jozries9S+JVvqC/a/nIFidEZF/cjH+mJnwGqfaFLlcpKwDDMIxSppR9AIZhGCWNKQDDMIwSxRSAYRhGiWIKwDAMo0QxBWAYhlGi/H9k26hw1Lr/YAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1b60938fda0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# theLambda = 100 时，欠拟合\n",
    "for i in range(m):\n",
    "    x = X[i]\n",
    "    if y[i] == 1:\n",
    "        plt.scatter(x[1], x[2], marker='*', color='blue', s=50)\n",
    "    else:\n",
    "        plt.scatter(x[1], x[2], marker='o', color='green', s=50)\n",
    "\n",
    "# 绘制决策边界\n",
    "x1Min,x1Max,x2Min,x2Max = X[:, 1].min(), X[:, 1].max(), X[:, 2].min(), X[:, 2].max()\n",
    "xx1, xx2 = np.meshgrid(np.linspace(x1Min, x1Max), np.linspace(x2Min, x2Max))\n",
    "h = sigmoid(poly.fit_transform(np.c_[xx1.ravel(), xx2.ravel()]).dot(thetas[-1]))\n",
    "h = h.reshape(xx1.shape)\n",
    "plt.contour(xx1, xx2, h, [0.5], colors='red', linewidth=.5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Anaconda\\lib\\site-packages\\matplotlib\\contour.py:967: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.contour.QuadContourSet at 0x1b60bed92b0>"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD6CAYAAACoCZCsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJztnXmYFNX1sN8zK8PMoCgIioAiIGFVICyCigYViQuiP8fIJzHiEqNGgkmAgIkkCgkaIhrBBdxFQY1ECKsLAQSEAVncEBVERBSFyDDAsMz5/rjdzjjTPdNLVVd1932fp57urq7uOlXTc8+9ZxVVxWKxWCzpR4bXAlgsFovFG6wCsFgsljTFKgCLxWJJU6wCsFgsljTFKgCLxWJJU6wCsFgsljTFKgCLxWJJU6wCsFgsljTFKgCLxWJJU7K8FqAmGjRooCeddJLXYlgsFktSsXr16m9UtWFtx/laAZx00kkUFxd7LYbFYrEkFSLyWSTHWROQxWKxpClWAVgsFkuaYhWAxWKxpClWAVgsFkuaYhWAxWKxpClWAVgsFkuaYhWAxWKxpClWA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yQDOAUYFdq1X1bLA82IgLrNBHLKFkmNvhJ91WzZE5BjgQeDyGuR1ikiuO9Qxjt6vOGRL9P2KVj7Xf2txyOb6/2icBK/hO8w17A2zL+GkzQogBKupWE52ArbUcOyZwNtakTTxjIh0EpFMYACwziPZQskRzXW5JpuI5AAvAiNVNVjQz837FolcoY5x+35FJJsH9ysq+cLI4ot7FyDR/6PR4NXvrnZUNS03oB7mRzEB+AA4CmgL3B3i2LHAwEqv2wPrgQ3APV7JFkoOjFJ/C5gIbARO9ki2m4HdwKLAVuTmfQshV6cQMoWSvdq+BPw9Q8mW0PsVg3wJ/61FKlvguIT+j4Y4/6LA47nArVXeaw68F7hPq4DMUPvcljHUltaZwAEP/nnAYlXd4bU8lYlHNhHJA34KrFHVT/0km5tEIleoYxJxPX69Z0Filc/t31o8svkJETkBM+OfrwGfQah9CZcrnRWAxWKxpDPp7AOwWCyWtMYqAIvFYklTrAKwWCyWNMUqAIvFYklTrAKwWCyWNOX/A5v0dy20cEzCAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1b60bed9ac8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# theLambda = 0时拟合效果较好\n",
    "for i in range(m):\n",
    "    x = X[i]\n",
    "    if y[i] == 1:\n",
    "        plt.scatter(x[1], x[2], marker='*', color='blue', s=50)\n",
    "    else:\n",
    "        plt.scatter(x[1], x[2], marker='o', color='green', s=50)\n",
    "\n",
    "# 绘制决策边界\n",
    "x1Min,x1Max,x2Min,x2Max = X[:, 1].min(), X[:, 1].max(), X[:, 2].min(), X[:, 2].max()\n",
    "xx1, xx2 = np.meshgrid(np.linspace(x1Min, x1Max), np.linspace(x2Min, x2Max))\n",
    "h = sigmoid(poly.fit_transform(np.c_[xx1.ravel(), xx2.ravel()]).dot(thetas[-1]))\n",
    "h = h.reshape(xx1.shape)\n",
    "plt.contour(xx1, xx2, h, [0.5], colors='red', linewidth=.5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
